import { Markdown } from './markdown'
import emitter from './mitt'

const Up1stWord = (word) => {
  return word.charAt(0).toUpperCase() + word.slice(1)
}
const isDaytime = () => {
  const currentHour = new Date().getHours()
  const startOfDay = 6
  const endOfDay = 18

  return currentHour >= startOfDay && currentHour < endOfDay
}
const openThirdParty = (url) => {
  window.open(url, '_blank')
}

export const scrollTop = () => {
  window.scrollTo({
    top: 0,
    left: 0,
    behavior: 'smooth'
  })
}

export { Markdown, isDaytime, emitter, Up1stWord, openThirdParty }
